$('#goPay').click(function(){
    var money = $('input[name="money"]').val();
    if (money && parseFloat(money) > 0){
        /* global isMiniProgram wx */
        if ( isMiniProgram () ) {//小程序就跳转小程序支付
            var params = {
                type: 100,//支付类型
                id: getCookie('userId'),//关联id
                payMoney: money,//支付金额
                content:'用户充值',//订单说明
                jumpUrl:'/pages/my_wallet',//支付成功后跳转地址  为空返回当前页面 不可以带 ? 和 &
            };
            wx.miniProgram.navigateTo({
                url: "/pages/pay/index?params=" + JSON.stringify(params)
            });
        } else {
            /* global getCookie servicePay*/
            $.post('/antique/api/onlinePay/wxpay/create_wxpay', {
                token:getCookie('token'),
                type:100,
                appSource:1,
                keyId:getCookie('userId'),
                money:servicePay(money),
                content:'用户充值' + money
            }, function (result) {
                var appId = result.data.appid;
                var nonceStr = result.data.nonce_str;
                var prepay_id = result.data.prepay_id;
                var mch_id = result.data.mch_id;
                /* global goWeiPay */
                goWeiPay(appId,nonceStr,prepay_id,mch_id);
            });
        }
    } else {
        $.toast("金钱不能为0或不填写", "cancel");
    }
});